//
//  ScheduleObject.m
//  FMS
//
//  Created by Steven on 10/11/13.
//  Copyright (c) 2013 QGSVN. All rights reserved.
//

#import "ScheduleObject.h"

@implementation ScheduleObject

@synthesize scheduleCategory,camp,service,unit;
@synthesize typeRequirement,itemType,startDate,endDate,lastUpdate,building,floor,room,personInCharge,reMark;
- (ScheduleObject*)initWithScheduleDict:(NSMutableDictionary *)scheduleDict{
    self = [super init];
    if (self) {
        scheduleCategory = [scheduleDict objectForKey:@"scheduleCategory"];
        camp = [scheduleDict objectForKey:@"camp"];
        service = [scheduleDict objectForKey:@"service"];
        unit = [scheduleDict objectForKey:@"unit"];
        typeRequirement = [[scheduleDict objectForKey:@"typeRequirement"] intValue];
        itemType = [[scheduleDict objectForKey:@"itemType"] intValue];
        startDate = [scheduleDict objectForKey:@"startDate"];
        endDate = [scheduleDict objectForKey:@"endDate"];
        lastUpdate = [scheduleDict objectForKey:@"lastUpdate"];
        building = [scheduleDict objectForKey:@"building"];
        floor = [scheduleDict objectForKey:@"floor"];
        room = [scheduleDict objectForKey:@"room"];
        personInCharge = [scheduleDict objectForKey:@"personInCharge"];
        reMark = [scheduleDict objectForKey:@"reMark"];
    }
    return self;
}
- (NSMutableDictionary *)convertToDictionary{
    NSMutableDictionary *dictSchedule = [NSMutableDictionary dictionaryWithObjectsAndKeys:scheduleCategory,@"scheduleCategory",camp,@"camp",service,@"service",unit,@"unit",building,@"building",floor,@"floor",room,@"room",[NSNumber numberWithInt:typeRequirement],@"typeRequirement",[NSNumber numberWithInt:itemType],@"itemType",startDate,@"startDate",endDate,@"endDate",lastUpdate,@"lastUpdate",personInCharge,@"personInCharge",reMark,@"reMark",nil];
    return dictSchedule;
}
@end
